<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">

</div>
<script src="../js/vue.js"></script>
<script>
  const app=Vue.createApp({
      template: `
      <h1>计数器：{{count}}</h1>
      <button @click="add">+</button>
      <button @click="sub">-</button>
    `,
      data(){
          return{
              count:0,
          }
      },
      methods:{
          add:function (){
              console.log(this)
              this.count++
          },
          sub:function () {
              console.log(this)
              this.count--
          }
      }
  })
  app.mount("#app")
</script>
</body>
</html>
